using System.Collections;
using System.Collections.Generic;
using Commons;
using Datas;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class BackSlot : ComMonoBehaviour,IPointerClickHandler
{
    public Herbal slotItem;
    public Image slotImage;
    public TextMeshProUGUI slotText;
    public int bagId;
    
    
    /**背包物品被点击*/
    public void OnPointerClick(PointerEventData eventData)
    {
        //Debug.Log("背包物品被点击,ID:"+bagId);
       
        int index = SceneManager.GetActiveScene().buildIndex;
        
        Debug.Log(index);
        if (index==3)
        {
            Debug.Log("关闭");
            GameObject.Find("Panel_boxBackpack(Clone)").GetComponent<BackManage>().DeleteBack();
        }
        SendMsg(MsgData.BackSlotId, bagId);


        
    }

    protected override void OnBeforeDestroy()
    {
        
    }
}
